﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AllMovies : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ServiceReferenceMovieInfo.MovieInfoServiceClient MovieInfoService = new ServiceReferenceMovieInfo.MovieInfoServiceClient();

        if (Request.QueryString["q"] != null)
        {
            Repeater1.DataSource = MovieInfoService.GetAllMovies().Where(x => x.name.Contains(Request.QueryString["q"])).OrderBy(x => x.name);
            Repeater1.DataBind();
            titleHeader.InnerHtml = "Alle Film Som Matcher: " + Request.QueryString["q"];
        }
        else
        {
            Repeater1.DataSource = MovieInfoService.GetAllMovies();
            Repeater1.DataBind();
            titleHeader.InnerHtml = "Alle Film";
        }
    }
}